Week 16

 

Interface and Application Programming

 

 

Assignment

   write an application that interfaces with an input &/or output device that you made, comparing as many tool options as possible.

As i designed and got the output for this device in the input week,So I need to make the application in MIT app inventor and then i have to interface my board with the application,thereby controlling my device with the application using the Bluetooth.

In my board i used an IR transmitter receiver module available in Kuwait FabLab.

 

Items required for interfacing:

1- Board which is needed to interface.

2-Mobile application created in MIT App inventor.

3-Android Mobile phone.

4-Bluetooth module.

Bluetooth:

Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices, and building personal area networks (PANs). Invented by telecom vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS-232 data cables. (Wikipedia)

Bluetooth icon.jpgBluetooth icon.jpg
 

This week topic is so interesting in so many ways. Unfortunately I spent way too much time on Networking & Communication so I had little less time than I wanted for this week. Hopefully I would find time to get some extra cool stuff up and running. After scooping around for something I found out that I wanted to test the software Processing 3 that seems to have some kind of Arduino flavor to it.

Here I am using HC-06 module for blue toooth.

 

This weeks assignments

Programming the output device.

I used the same board in the output here

The code for the board is just  for turning on and Off .Which is controlled by application.

⁠⁠⁠#include <SoftwareSerial.h>

 SoftwareSerial mySerial(6, 255); // RX, TX

 #define LED 3

 char c;

 void setup() {

// Open serial communications and wait for port to open:

 mySerial.begin(9600);

 pinMode(LED, OUTPUT);

 digitalWrite(LED, LOW);

 }

 void loop() { // run over

 and over while (mySerial.available() <= 0);

 c = mySerial.read()

; if (c == '1') {

digitalWrite(LED, HIGH);

 delay(500);

}

 else

 digitalWrite(LED, LOW);

}

⁠⁠⁠

The Application development :

I used the MIT app inventor to create an application which can be used to control  my board.

MIT App inventor

 
 

The best thing in this is just dragging and dropping the blocks which we want to use. We can put different conditions inside the blocks.

 

 

Corresponding Screen is designed. I used Buttons, LED and ON and OFF options for controlling the switching action.

Blue tooth blocks are done to pick the bluetooth and there by I can connect my device to the android.

After completing the design.I can download the .apk file  which can be installed on any android device.

Video:

 

 

 

 
File: Aia file of App inventor